import React from 'react'
import { Button } from 'antd'
import { useSwitch } from '../../utils/useSwitch'

const Index: React.FC = () => {
  const { toggle, state } = useSwitch()

  return (
    <div>
      <h1>颜色切换</h1>
      <Button type={state ? 'primary' : undefined} onClick={toggle}>
        切换主题
      </Button>
    </div>
  )
}

export default Index
